
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>6.3 存储内存管理 · 大数据 bigdata_spark_kernel-optimize_atguigu 课堂笔记</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content=" 李振超">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-page-toc-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-prism/prism-solarizedlight.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-change_girls/girls.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="styles/website.css">
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="64-zhi-xing-nei-cun-guan-li.html" />
    
    
    <link rel="prev" href="62-nei-cun-kong-jian-fen-pei.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://www.atguigu.com/" target="_blank" class="custom-link">联系我们</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        <li class="header">第 1 部分: Spark 内核</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    第 1 章 Spark 内核概述
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="11-spark-he-xin-zu-jian-hui-gu.html">
            
                <a href="11-spark-he-xin-zu-jian-hui-gu.html">
            
                    
                    1.1 Spark 核心组件回顾
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="12-spark-tong-yong-yun-xing-liu-cheng-gai-shu.html">
            
                <a href="12-spark-tong-yong-yun-xing-liu-cheng-gai-shu.html">
            
                    
                    1.2 Spark 通用运行流程概述
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="chapter1.html">
            
                <a href="chapter1.html">
            
                    
                    第 2 章 Spark 通讯架构
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="chapter1/21-spark-tong-xun-jia-gou-gai-shu.html">
            
                <a href="chapter1/21-spark-tong-xun-jia-gou-gai-shu.html">
            
                    
                    2.1 Spark 通讯架构概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="chapter1/23-spark-tong-xin-jia-gou-jie-xi.html">
            
                <a href="chapter1/23-spark-tong-xin-jia-gou-jie-xi.html">
            
                    
                    2.2 Spark 通信架构解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="chapter1/22-spark-qi-dong-liu-cheng-fen-xi.html">
            
                <a href="chapter1/22-spark-qi-dong-liu-cheng-fen-xi.html">
            
                    
                    2.3 Spark 启动流程分析
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.3.1" data-path="chapter1/22-spark-qi-dong-liu-cheng-fen-xi/231-master-liu-cheng-fen-xi.html">
            
                <a href="chapter1/22-spark-qi-dong-liu-cheng-fen-xi/231-master-liu-cheng-fen-xi.html">
            
                    
                    2.3.1 Master 启动源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3.2" data-path="chapter1/22-spark-qi-dong-liu-cheng-fen-xi/232-worker-liu-cheng-fen-xi.html">
            
                <a href="chapter1/22-spark-qi-dong-liu-cheng-fen-xi/232-worker-liu-cheng-fen-xi.html">
            
                    
                    2.3.2 Worker 启动源码分析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="di-3-zhang-spark-bu-shu-mo-shi.html">
            
                <a href="di-3-zhang-spark-bu-shu-mo-shi.html">
            
                    
                    第 3 章 Spark 部署模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi.html">
            
                <a href="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi.html">
            
                    
                    3.1 Yarn 模式运行机制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1.1" data-path="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi/yarn-mo-shi-yun-xing-ji-zhi-yuan-ma-fen-xi.html">
            
                <a href="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi/yarn-mo-shi-yun-xing-ji-zhi-yuan-ma-fen-xi.html">
            
                    
                    1. Yarn cluster 模式运行机制源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.1.2" data-path="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi/yarn-client-mo-shi-yun-xing-ji-zhi-yuan-ma-fen-xi.html">
            
                <a href="di-3-zhang-spark-bu-shu-mo-shi/31-yarn-mo-shi-yun-xing-ji-zhi/yarn-client-mo-shi-yun-xing-ji-zhi-yuan-ma-fen-xi.html">
            
                    
                    2. Yarn client 模式运行机制源码分析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="di-3-zhang-spark-bu-shu-mo-shi/32-standalone-mo-shi-yun-xing-ji-zhi.html">
            
                <a href="di-3-zhang-spark-bu-shu-mo-shi/32-standalone-mo-shi-yun-xing-ji-zhi.html">
            
                    
                    3.2 Standalone 模式运行机制
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi.html">
            
                    
                    第 4 章 Spark 任务调度机制
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/41-spark-ren-wu-diao-du-gai-shu.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/41-spark-ren-wu-diao-du-gai-shu.html">
            
                    
                    4.1 Spark 任务调度概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/42-spark-stage-ji-bie-diao-du.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/42-spark-stage-ji-bie-diao-du.html">
            
                    
                    4.2 Spark Stage 级别调度
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du.html">
            
                    
                    4.3 Spark Task 级别调度
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.3.1" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/431-diao-du-ce-lve.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/431-diao-du-ce-lve.html">
            
                    
                    4.3.1 调度策略
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.2" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/432-ben-di-hua-diao-du.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/432-ben-di-hua-diao-du.html">
            
                    
                    4.3.2 本地化调度
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.3" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/433-shi-bai-zhong-shi-he-hei-ming-dan.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/43-spark-task-ji-bie-diao-du/433-shi-bai-zhong-shi-he-hei-ming-dan.html">
            
                    
                    4.3.3 失败重试和黑名单
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/44-ren-wu-diao-du-yuan-ma-fen-xi.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/44-ren-wu-diao-du-yuan-ma-fen-xi.html">
            
                    
                    4.4 Stage 级别任务调度源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/45-task-ji-bie-ren-wu-diao-du-yuan-ma-fen-xi.html">
            
                <a href="di-4-zhang-spark-ren-wu-diao-du-ji-zhi/45-task-ji-bie-ren-wu-diao-du-yuan-ma-fen-xi.html">
            
                    
                    4.5 Task 级别任务调度源码分析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="di-5-zhang-spark-shuffle-jie-xi.html">
            
                <a href="di-5-zhang-spark-shuffle-jie-xi.html">
            
                    
                    第 5 章 Spark Shuffle 解析
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="di-5-zhang-spark-shuffle-jie-xi/51-shuffle-de-he-xin-yao-dian.html">
            
                <a href="di-5-zhang-spark-shuffle-jie-xi/51-shuffle-de-he-xin-yao-dian.html">
            
                    
                    5.1 Shuffle 的核心要点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="di-5-zhang-spark-shuffle-jie-xi/52-hashshuffle-jie-xi.html">
            
                <a href="di-5-zhang-spark-shuffle-jie-xi/52-hashshuffle-jie-xi.html">
            
                    
                    5.2 HashShuffle 解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="di-5-zhang-spark-shuffle-jie-xi/53-sortshuffle-jie-xi.html">
            
                <a href="di-5-zhang-spark-shuffle-jie-xi/53-sortshuffle-jie-xi.html">
            
                    
                    5.3 SortShuffle 解析
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.3.1" data-path="di-5-zhang-spark-shuffle-jie-xi/53-sortshuffle-jie-xi/sortshuffle-yuan-ma-jie-xi.html">
            
                <a href="di-5-zhang-spark-shuffle-jie-xi/53-sortshuffle-jie-xi/sortshuffle-yuan-ma-jie-xi.html">
            
                    
                    SortShuffle 源码解析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="di-6-zhang-spark-nei-cun-jie-xi.html">
            
                <a href="di-6-zhang-spark-nei-cun-jie-xi.html">
            
                    
                    第 6 章 Spark 内存管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="61-dui-nei-he-dui-wai-nei-cun-gui-hua.html">
            
                <a href="61-dui-nei-he-dui-wai-nei-cun-gui-hua.html">
            
                    
                    6.1 堆内核堆外内存规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="62-nei-cun-kong-jian-fen-pei.html">
            
                <a href="62-nei-cun-kong-jian-fen-pei.html">
            
                    
                    6.2 内存空间分配
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.6.3" data-path="63-cun-chu-nei-cun-guan-li.html">
            
                <a href="63-cun-chu-nei-cun-guan-li.html">
            
                    
                    6.3 存储内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="64-zhi-xing-nei-cun-guan-li.html">
            
                <a href="64-zhi-xing-nei-cun-guan-li.html">
            
                    
                    6.4 执行内存管理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">第 2 部分: Spark 性能优化和故障处理</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua.html">
            
                    
                    第 7 章 Spark 性能优化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/71-chang-gui-xing-neng-diao-you.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/71-chang-gui-xing-neng-diao-you.html">
            
                    
                    7.1 常规性能调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/72-suan-zi-diao-you.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/72-suan-zi-diao-you.html">
            
                    
                    7.2 算子调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/73-shuffle-diao-you.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/73-shuffle-diao-you.html">
            
                    
                    7.3 Shuffle 调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.4" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/74-jvm-diao-you.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-7-zhang-spark-xing-neng-you-hua/74-jvm-diao-you.html">
            
                    
                    7.4 JVM 调优
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-8-zhang-spark-shu-ju-qing-xie.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-8-zhang-spark-shu-ju-qing-xie.html">
            
                    
                    第 8 章 Spark 数据倾斜解决方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-9-zhang-spark-troubleshooting.html">
            
                <a href="di-2-bu-52063a-spark-xing-neng-you-hua-he-gu-zhang-chu-li/di-9-zhang-spark-troubleshooting.html">
            
                    
                    第 9 章 Spark Troubleshooting
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >6.3 存储内存管理</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="63-&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x7BA1;&#x7406;">6.3 &#x5B58;&#x50A8;&#x5185;&#x5B58;&#x7BA1;&#x7406;</h1>
<h2 id="631-rdd-&#x7684;&#x6301;&#x4E45;&#x5316;&#x673A;&#x5236;">6.3.1 RDD &#x7684;&#x6301;&#x4E45;&#x5316;&#x673A;&#x5236;</h2>
<p>RDD &#x4F5C;&#x4E3A; Spark &#x6700;&#x57FA;&#x672C;&#x7684;&#x6570;&#x636E;&#x62BD;&#x8C61;, &#x662F;&#x5206;&#x533A;&#x8BB0;&#x5F55;(partition)&#x7684;&#x53EA;&#x8BFB;&#x96C6;&#x5408;, &#x53EA;&#x80FD;&#x57FA;&#x4E8E;&#x5728;&#x7A33;&#x5B9A;&#x7269;&#x7406;&#x5B58;&#x50A8;&#x4E2D;&#x7684;&#x6570;&#x636E;&#x96C6;&#x4E0A;&#x521B;&#x5EFA;, &#x6216;&#x8005;&#x5728;&#x5176;&#x4ED6;&#x5DF2;&#x6709;&#x7684; RDD &#x4E0A;&#x6267;&#x884C;&#x8F6C;&#x6362;(Transformation)&#x64CD;&#x4F5C;&#x4EA7;&#x751F;&#x4E00;&#x4E2A;&#x65B0;&#x7684; RDD.</p>
<p>&#x8F6C;&#x6362;&#x540E;&#x7684; RDD &#x4E0E;&#x539F;&#x59CB;&#x7684; RDD &#x4E4B;&#x95F4;&#x4EA7;&#x751F;&#x7684;&#x4F9D;&#x8D56;&#x5173;&#x7CFB;, &#x6784;&#x6210;&#x4E86;&#x8840;&#x7EDF;(Lineage). &#x51ED;&#x501F;&#x8840;&#x7EDF;, Spark &#x53EF;&#x4EE5;&#x4FDD;&#x8BC1;&#x6BCF;&#x4E00;&#x4E2A; RDD &#x90FD;&#x53EF;&#x4EE5;&#x88AB;&#x91CD;&#x65B0;&#x6062;&#x590D;.</p>
<p>&#x4F46; RDD &#x7684;&#x6240;&#x6709;&#x8F6C;&#x6362;&#x90FD;&#x662F;&#x60F0;&#x6027;&#x7684;, &#x5373;&#x53EA;&#x6709;&#x5F53;&#x884C;&#x52A8;(Action)&#x53D1;&#x751F;&#x65F6;, Spark &#x624D;&#x4F1A;&#x521B;&#x5EFA;&#x4EFB;&#x52A1;&#x8BFB;&#x53D6; RDD, &#x7136;&#x540E;&#x624D;&#x4F1A;&#x771F;&#x6B63;&#x7684;&#x6267;&#x884C;&#x8F6C;&#x6362;&#x64CD;&#x4F5C;.</p>
<p>Task &#x5728;&#x542F;&#x52A8;&#x4E4B;&#x521D;&#x8BFB;&#x53D6;&#x4E00;&#x4E2A;&#x5206;&#x533A;&#x7684;&#x65F6;, &#x4F1A;&#x5148;&#x5224;&#x65AD;&#x8FD9;&#x4E2A;&#x5206;&#x533A;&#x662F;&#x5426;&#x5DF2;&#x7ECF;&#x88AB;&#x6301;&#x4E45;&#x5316;, &#x5982;&#x679C;&#x6CA1;&#x6709;&#x5219;&#x9700;&#x8981;&#x68C0;&#x67E5; Checkpoint &#x6216;&#x6309;&#x7167;&#x8840;&#x7EDF;&#x91CD;&#x65B0;&#x8BA1;&#x7B97;.</p>
<p>&#x5982;&#x679C;&#x8981;&#x5728;&#x4E00;&#x4E2A; RDD &#x4E0A;&#x6267;&#x884C;&#x591A;&#x6B21;&#x884C;&#x52A8;, &#x53EF;&#x4EE5;&#x5728;&#x7B2C;&#x4E00;&#x6B21;&#x884C;&#x52A8;&#x4E2D;&#x4F7F;&#x7528; persis &#x6216; cache &#x65B9;&#x6CD5;, &#x5728;&#x5185;&#x5B58;&#x6216;&#x78C1;&#x76D8;&#x4E2D;&#x6301;&#x4E45;&#x5316;&#x6216;&#x7F13;&#x5B58;&#x8FD9;&#x4E2A; RDD, &#x4ECE;&#x800C;&#x5728;&#x540E;&#x9762;&#x7684;Action &#x65F6;&#x63D0;&#x793A;&#x8BA1;&#x7B97;&#x901F;&#x5EA6;.</p>
<p>&#x4E8B;&#x5B9E;&#x4E0A;, cache &#x65B9;&#x6CD5;&#x662F;&#x4F7F;&#x7528;&#x9ED8;&#x8BA4;&#x7684; <code>MEMORY_ONLY</code>&#x7684;&#x5B58;&#x50A8;&#x7EA7;&#x522B;&#x5C06; RDD &#x6301;&#x4E45;&#x5316;&#x5230;&#x5185;&#x5B58;, &#x6240;&#x4EE5;&#x7F13;&#x5B58;&#x662F;&#x4E00;&#x79CD;&#x7279;&#x6B8A;&#x7684;&#x6301;&#x4E45;&#x5316;.</p>
<my>&#x5806;&#x5185;&#x5185;&#x5B58;&#x548C;&#x5806;&#x5916;&#x5185;&#x5B58;&#x7684;&#x8BBE;&#x8BA1;, &#x4FBF;&#x53EF;&#x4EE5;&#x5BF9;&#x7F13;&#x5B58; RDD &#x65F6;&#x4F7F;&#x7528;&#x7684;&#x5185;&#x5B58;&#x505A;&#x7EDF;&#x4E00;&#x7684;&#x89C4;&#x5212;&#x548C;&#x7BA1;&#x7406;</my>

<p>RDD &#x7684;&#x6301;&#x4E45;&#x5316;&#x7531; Spark &#x7684; Storage &#x6A21;&#x5757;&#x8D1F;&#x8D23;, &#x5B9E;&#x73B0;&#x4E86; RDD &#x4E0E;&#x7269;&#x7406;&#x5B58;&#x50A8;&#x7684;&#x7D27;&#x8026;&#x5408;.</p>
<p>Storage &#x6A21;&#x5757;&#x8D1F;&#x8D23;&#x7BA1;&#x7406; Spark &#x5728;&#x8BA1;&#x7B97;&#x8FC7;&#x7A0B;&#x4E2D;&#x4EA7;&#x751F;&#x7684;&#x6570;&#x636E;, &#x5C06;&#x90A3;&#x4E9B;&#x5728;&#x5185;&#x5B58;&#x6216;&#x78C1;&#x76D8;, &#x5728;&#x672C;&#x5730;&#x6216;&#x8FDC;&#x7A0B;&#x5B58;&#x53D6;&#x6570;&#x636E;&#x7684;&#x529F;&#x80FD;&#x5C01;&#x88C5;&#x4E86;&#x8D77;&#x6765;.</p>
<p>&#x5728;&#x5177;&#x4F53;&#x5B9E;&#x73B0;&#x65F6; Driver &#x7AEF;&#x548C; Executor &#x7AEF;&#x7684; Storage &#x6A21;&#x5757;&#x6784;&#x6210;&#x4E86;&#x4E3B;&#x4ECE;&#x5F0F;&#x7684;&#x67B6;&#x6784;: &#x5373; Driver &#x7AEF;&#x7684; BlockManager &#x4E3A; Master, Executor &#x7AEF;&#x7684; BlockManager &#x4E3A; Slave. Storage &#x6A21;&#x5757;&#x5728;&#x903B;&#x8F91;&#x4E0A;&#x4EE5; Block &#x4E3A;&#x57FA;&#x672C;&#x5B58;&#x50A8;&#x5355;&#x4F4D;, RDD &#x7684;&#x6BCF;&#x4E2A; Partition &#x7ECF;&#x8FC7;&#x5904;&#x7406;&#x540E;&#x552F;&#x4E00;&#x5BF9;&#x5E94;&#x4E00;&#x4E2A; Block. Master &#x8D1F;&#x8D23;&#x6574;&#x4E2A; Spark &#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x7684; Block &#x5143;&#x6570;&#x636E;&#x4FE1;&#x606F;&#x7684;&#x7BA1;&#x7406;&#x548C;&#x7EF4;&#x62A4;, &#x800C; Slave &#x9700;&#x8981;&#x5C06; Block &#x7684;&#x66F4;&#x65B0;&#x72B6;&#x6001;&#x4E0A;&#x62A5;&#x5230; Master, &#x540C;&#x65F6;&#x63A5;&#x6536; Master &#x7684;&#x547D;&#x4EE4;, &#x4F8B;&#x5982;&#x65B0;&#x589E;&#x6216;&#x5220;&#x9664;&#x4E00;&#x4E2A; RDD</p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1554784821.png" alt=""></p>
<p>&#x5728;&#x5BF9; RDD &#x6301;&#x4E45;&#x5316;&#x65F6;&#xFF0C;Spark &#x89C4;&#x5B9A;&#x4E86; <code>MEMORY_ONLY</code>&#x3001;<code>MEMORY_AND_DISK</code> &#x7B49; 7 &#x79CD;&#x4E0D;&#x540C;&#x7684;&#x5B58;&#x50A8;&#x7EA7;&#x522B; &#xFF0C;&#x800C;&#x5B58;&#x50A8;&#x7EA7;&#x522B;&#x662F;&#x4EE5;&#x4E0B; 5 &#x4E2A;&#x53D8;&#x91CF;&#x7684;&#x7EC4;&#x5408;&#xFF1A;</p>
<pre class="language-"><code class="lang-scala"><span class="token keyword">class</span> StorageLevel <span class="token keyword">private</span><span class="token punctuation">(</span>
    <span class="token keyword">private</span> <span class="token keyword">var</span> _useDisk<span class="token operator">:</span> <span class="token builtin">Boolean</span><span class="token punctuation">,</span>
    <span class="token keyword">private</span> <span class="token keyword">var</span> _useMemory<span class="token operator">:</span> <span class="token builtin">Boolean</span><span class="token punctuation">,</span>
    <span class="token keyword">private</span> <span class="token keyword">var</span> _useOffHeap<span class="token operator">:</span> <span class="token builtin">Boolean</span><span class="token punctuation">,</span>
    <span class="token keyword">private</span> <span class="token keyword">var</span> _deserialized<span class="token operator">:</span> <span class="token builtin">Boolean</span><span class="token punctuation">,</span>
    <span class="token keyword">private</span> <span class="token keyword">var</span> _replication<span class="token operator">:</span> <span class="token builtin">Int</span> <span class="token operator">=</span> <span class="token number">1</span><span class="token punctuation">)</span>
</code></pre>
<blockquote>
<p>7 &#x79CD;&#x5B58;&#x50A8;&#x7EA7;&#x522B;&#x8BF7;&#x53C2;&#x8003;: <a href="http://www.zhenchao.cf/bigdata_spark_atguigu/di-2-bu-fen-spark-core/di-5-zhang-rdd-bian-cheng/50-rdd-de-chi-jiu-hua.html" target="_blank">http://www.zhenchao.cf/bigdata_spark_atguigu/di-2-bu-fen-spark-core/di-5-zhang-rdd-bian-cheng/50-rdd-de-chi-jiu-hua.html</a></p>
</blockquote>
<p>&#x901A;&#x8FC7;&#x5BF9;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x7684;&#x5206;&#x6790;&#xFF0C;&#x53EF;&#x4EE5;&#x770B;&#x51FA;&#x5B58;&#x50A8;&#x7EA7;&#x522B;&#x4ECE;&#x4E09;&#x4E2A;&#x7EF4;&#x5EA6;&#x5B9A;&#x4E49;&#x4E86; RDD &#x7684; Partition&#xFF08;&#x540C;&#x65F6;&#x4E5F;&#x5C31;&#x662F; Block&#xFF09;&#x7684;&#x5B58;&#x50A8;&#x65B9;&#x5F0F;&#xFF1A;</p>
<ol>
<li><p>&#x5B58;&#x50A8;&#x4F4D;&#x7F6E;&#xFF1A;&#x78C1;&#x76D8;&#xFF0F;&#x5806;&#x5185;&#x5185;&#x5B58;&#xFF0F;&#x5806;&#x5916;&#x5185;&#x5B58;&#x3002;&#x5982; <code>MEMORY_AND_DISK</code> &#x662F;&#x540C;&#x65F6;&#x5728;&#x78C1;&#x76D8;&#x548C;&#x5806;&#x5185;&#x5185;&#x5B58;&#x4E0A;&#x5B58;&#x50A8;&#xFF0C;&#x5B9E;&#x73B0;&#x4E86;&#x5197;&#x4F59;&#x5907;&#x4EFD;&#x3002;<code>OFF_HEAP</code> &#x5219;&#x662F;&#x53EA;&#x5728;&#x5806;&#x5916;&#x5185;&#x5B58;&#x5B58;&#x50A8;&#xFF0C;&#x76EE;&#x524D;&#x9009;&#x62E9;&#x5806;&#x5916;&#x5185;&#x5B58;&#x65F6;&#x4E0D;&#x80FD;&#x540C;&#x65F6;&#x5B58;&#x50A8;&#x5230;&#x5176;&#x4ED6;&#x4F4D;&#x7F6E;&#x3002;</p>
</li>
<li><p>&#x5B58;&#x50A8;&#x5F62;&#x5F0F;&#xFF1A;<code>Block</code> &#x7F13;&#x5B58;&#x5230;&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x540E;&#xFF0C;&#x662F;&#x5426;&#x4E3A;&#x975E;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x5F62;&#x5F0F;&#x3002;&#x5982; <code>MEMORY_ONLY</code> &#x662F;&#x975E;&#x5E8F;&#x5217;&#x5316;&#x65B9;&#x5F0F;&#x5B58;&#x50A8;&#xFF0C;<code>OFF_HEAP</code> &#x662F;&#x5E8F;&#x5217;&#x5316;&#x65B9;&#x5F0F;&#x5B58;&#x50A8;&#x3002;</p>
</li>
<li><p>&#x526F;&#x672C;&#x6570;&#x91CF;&#xFF1A;&#x5927;&#x4E8E; 1 &#x65F6;&#x9700;&#x8981;&#x8FDC;&#x7A0B;&#x5197;&#x4F59;&#x5907;&#x4EFD;&#x5230;&#x5176;&#x4ED6;&#x8282;&#x70B9;&#x3002;&#x5982; <code>DISK_ONLY_2</code> &#x9700;&#x8981;&#x8FDC;&#x7A0B;&#x5907;&#x4EFD; 1 &#x4E2A;&#x526F;&#x672C;&#x3002;</p>
</li>
</ol>
<h2 id="632-rdd-&#x7684;&#x7F13;&#x5B58;&#x8FC7;&#x7A0B;">6.3.2 RDD &#x7684;&#x7F13;&#x5B58;&#x8FC7;&#x7A0B;</h2>
<p>RDD &#x5728;&#x7F13;&#x5B58;&#x5230;&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x4E4B;&#x524D;, Partition &#x4E2D;&#x7684;&#x6570;&#x636E;&#x4E00;&#x822C;&#x4EE5;&#x8FED;&#x4EE3;&#x5668;(<code>Iterator</code>)&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x6765;&#x8BBF;&#x95EE;, &#x8FD9;&#x662F; Scala &#x8BED;&#x8A00;&#x4E2D;&#x904D;&#x5386;&#x6570;&#x636E;&#x96C6;&#x5408;&#x7684;&#x65B9;&#x6CD5;. &#x901A;&#x8FC7; Iterator &#x53EF;&#x4EE5;&#x83B7;&#x53D6;&#x5206;&#x533A;&#x4E2D;&#x6BCF;&#x4E00;&#x6761;&#x5E8F;&#x5217;&#x5316;&#x6216;&#x8005;&#x975E;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x6570;&#x636E;&#x9879;(<code>Record</code>), &#x8FD9;&#x4E9B; <code>Record</code>&#x7684;&#x5BF9;&#x8C61;&#x5B9E;&#x4F8B;&#x5728;&#x903B;&#x8F91;&#x4E0A;&#x5360;&#x7528;&#x4E86; JVM &#x5806;&#x5185;&#x5185;&#x5B58;&#x7684; other &#x90E8;&#x5206;&#x7684;&#x7A7A;&#x95F4;, &#x540C;&#x4E00; Partition &#x7684;&#x4E0D;&#x540C; <code>Record</code> &#x7684;&#x7A7A;&#x95F4;&#x5E76;&#x4E0D;&#x8FDE;&#x7EED;.</p>
<p>RDD &#x5728;&#x7F13;&#x5B58;&#x5230;&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x4E4B;&#x540E;, Partition &#x88AB;&#x8F6C;&#x6362;&#x6210; Block, Record &#x5728;&#x5806;&#x5185;&#x5185;&#x5B58;&#x6216;&#x5806;&#x5916;&#x5185;&#x5B58;&#x4E2D;&#x5360;&#x7528;&#x4E00;&#x5757;&#x8FDE;&#x7EED;&#x7684;&#x7A7A;&#x95F4;.</p>
<my>&#x5C06; Partition &#x7531;&#x4E0D;&#x8FDE;&#x7EED;&#x7684;&#x5B58;&#x50A8;&#x7A7A;&#x95F4;&#x8F6C;&#x6362;&#x4E3A;&#x8FDE;&#x7EED;&#x5B58;&#x50A8;&#x7A7A;&#x95F4;&#x7684;&#x8FC7;&#x7A0B;, Spark &#x79F0;&#x4E4B;&#x4E3A;&#x5C55;&#x5F00;(Unroll)</my>

<p>Block &#x6709;&#x5E8F;&#x5217;&#x5316;&#x548C;&#x975E;&#x5E8F;&#x5217;&#x5316;&#x4E24;&#x79CD;&#x5B58;&#x50A8;&#x683C;&#x5F0F;, &#x5177;&#x4F53;&#x4EE5;&#x54EA;&#x79CD;&#x65B9;&#x5F0F;&#x5B58;&#x53D6;&#x51B3;&#x4E8E;&#x8BE5; RDD &#x7684;&#x5B58;&#x50A8;&#x7EA7;&#x522B;.</p>
<p>&#x975E;&#x5E8F;&#x5217;&#x5316;&#x7684; Block &#x4EE5;&#x4E00;&#x79CD; <code>DeserializedMemoryEntry</code> &#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x5B9A;&#x4E49;, &#x7528;&#x4E00;&#x4E2A;&#x6570;&#x7EC4;&#x5B58;&#x50A8;&#x6240;&#x6709;&#x7684;&#x5BF9;&#x8C61;&#x5B9E;&#x4F8B;, &#x5E8F;&#x5217;&#x5316;&#x7684; Block &#x5219;&#x4EE5; <code>SerializedMemoryEntry</code>&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784;&#x5B9A;&#x4E49;, &#x7528;&#x5B57;&#x8282;&#x7F13;&#x51B2;&#x533A;(<code>ByteBuffer</code>)&#x6765;&#x5B58;&#x50A8;&#x4E8C;&#x8FDB;&#x5236;&#x6570;&#x636E;. </p>
<p>&#x6BCF;&#x4E2A; Executor &#x7684; Storage &#x6A21;&#x5757;&#x7528;&#x4E00;&#x4E2A;&#x94FE;&#x5F0F; Map &#x7ED3;&#x6784;(<code>LinkedHashMap</code>)&#x6765;&#x7BA1;&#x7406;&#x5806;&#x5185;&#x548C;&#x5806;&#x5916;&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x4E2D;&#x6240;&#x6709;&#x7684; Block &#x5BF9;&#x8C61;&#x7684;&#x5B9E;&#x4F8B;, &#x5BF9;&#x8FD9;&#x4E2A;<code>LinkedHashMap</code>&#x65B0;&#x589E;&#x548C;&#x5220;&#x9664;, &#x95F4;&#x63A5;&#x8BB0;&#x5F55;&#x4E86;&#x5185;&#x5B58;&#x7684;&#x7533;&#x8BF7;&#x548C;&#x91CA;&#x653E;.</p>
<p>&#x56E0;&#x4E3A;&#x4E0D;&#x80FD;&#x4FDD;&#x8BC1;&#x5B58;&#x50A8;&#x7A7A;&#x95F4;&#x53EF;&#x4EE5;&#x4E00;&#x6B21;&#x5BB9;&#x7EB3;<code>Iterator</code>&#x4E2D;&#x7684;&#x6240;&#x6709;&#x6570;&#x636E;, &#x5F53;&#x524D;&#x7684;&#x8BA1;&#x7B97;&#x4EFB;&#x52A1;&#x5728; Unroll &#x65F6;&#x8981;&#x5411; MemoryManager &#x7533;&#x8BF7;&#x8DB3;&#x591F;&#x7684; Unroll &#x7A7A;&#x95F4;&#x6765;&#x4E34;&#x65F6;&#x5360;&#x4F4D;, &#x7A7A;&#x95F4;&#x4E0D;&#x8DB3;&#x5219; Unroll &#x5931;&#x8D25;, &#x7A7A;&#x95F4;&#x8DB3;&#x591F;&#x65F6;&#x53EF;&#x4EE5;&#x7EE7;&#x7EED;&#x8FDB;&#x884C;.</p>
<p>&#x5BF9;&#x4E8E;&#x5E8F;&#x5217;&#x5316;&#x7684; Partition, &#x5176;&#x6240;&#x9700;&#x7684; Unroll &#x7A7A;&#x95F4;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x7D2F;&#x52A0;&#x8BA1;&#x7B97;, &#x4E00;&#x6B21;&#x7533;&#x8BF7;. &#x800C;&#x5BF9;&#x4E8E;&#x975E;&#x5E8F;&#x5217;&#x5316;&#x7684; Partition &#x5219;&#x8981;&#x5728;&#x904D;&#x5386; Record &#x7684;&#x8FC7;&#x7A0B;&#x4E2D;&#x4F9D;&#x6B21;&#x7533;&#x8BF7;, &#x5373;&#x8BFB;&#x53D6;&#x4E00;&#x6761; <code>Record</code>, &#x91C7;&#x7528;&#x4F30;&#x7B97;&#x5668;&#x6240;&#x9700;&#x7684; Unroll &#x7A7A;&#x95F4;&#x5E76;&#x8FDB;&#x884C;&#x7533;&#x8BF7;, &#x7A7A;&#x95F4;&#x4E0D;&#x8DB3;&#x65F6;&#x53EF;&#x4EE5;&#x4E2D;&#x65AD;, &#x91CA;&#x653E;&#x5DF2;&#x5360;&#x7528;&#x7684; Unroll &#x7A7A;&#x95F4;. </p>
<p>&#x5982;&#x679C;&#x6700;&#x7EC8; Unroll &#x6210;&#x529F;, &#x5F53;&#x524D; Partition &#x6240;&#x5360;&#x7528;&#x7684; Unroll &#x7A7A;&#x95F4;&#x88AB;&#x8F6C;&#x6362;&#x4E3A;&#x6B63;&#x5E38;&#x7684;&#x7F13;&#x5B58; RDD &#x7684;&#x5B58;&#x50A8;&#x7A7A;&#x95F4;.</p>
<p><img src="http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/1554790484.png-atguiguText" alt=""></p>
<blockquote>
<h4 id="&#x8BF4;&#x660E;"><em>&#x8BF4;&#x660E;:</em></h4>
</blockquote>
<ul>
<li>&#x5728;&#x9759;&#x6001;&#x5185;&#x5B58;&#x7BA1;&#x7406;&#x65F6;&#xFF0C;Spark &#x5728;&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x4E2D;&#x4E13;&#x95E8;&#x5212;&#x5206;&#x4E86;&#x4E00;&#x5757; Unroll &#x7A7A;&#x95F4;&#xFF0C;&#x5176;&#x5927;&#x5C0F;&#x662F;&#x56FA;&#x5B9A;&#x7684;&#xFF0C;&#x7EDF;&#x4E00;&#x5185;&#x5B58;&#x7BA1;&#x7406;&#x65F6;&#x5219;&#x6CA1;&#x6709;&#x5BF9; Unroll &#x7A7A;&#x95F4;&#x8FDB;&#x884C;&#x7279;&#x522B;&#x533A;&#x5206;&#xFF0C;&#x5F53;&#x5B58;&#x50A8;&#x7A7A;&#x95F4;&#x4E0D;&#x8DB3;&#x65F6;&#x4F1A;&#x6839;&#x636E;&#x52A8;&#x6001;&#x5360;&#x7528;&#x673A;&#x5236;&#x8FDB;&#x884C;&#x5904;&#x7406;&#x3002;</li>
</ul>
<h2 id="632-&#x6DD8;&#x6C70;&#x548C;&#x843D;&#x76D8;">6.3.2 &#x6DD8;&#x6C70;&#x548C;&#x843D;&#x76D8;</h2>
<p>&#x7531;&#x4E8E;&#x540C;&#x4E00;&#x4E2A; Executor &#x7684;&#x6240;&#x6709;&#x7684;&#x8BA1;&#x7B97;&#x4EFB;&#x52A1;&#x5171;&#x4EAB;&#x6709;&#x9650;&#x7684;&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x7A7A;&#x95F4;, &#x5F53;&#x6709;&#x65B0;&#x7684; Block &#x9700;&#x8981;&#x7F13;&#x5B58;&#x4F46;&#x662F;&#x5269;&#x4F59;&#x7A7A;&#x95F4;&#x4E0D;&#x8DB3;&#x65E0;&#x6CD5;&#x52A8;&#x6001;&#x5360;&#x7528;&#x65F6;, &#x5C31;&#x8981;&#x5BF9; <code>LinkedHashMap</code>&#x4E2D;&#x7684;&#x65E7; Block &#x8FDB;&#x884C;&#x6DD8;&#x6C70;(Eviction), &#x800C;&#x88AB;&#x6DD8;&#x6C70;&#x7684; Block &#x5982;&#x679C;&#x5176;&#x5B58;&#x50A8;&#x7EA7;&#x522B;&#x4E2D;&#x540C;&#x65F6;&#x5305;&#x542B;&#x5B58;&#x50A8;&#x5230;&#x78C1;&#x76D8;&#x7684;&#x8981;&#x6C42;, &#x5219;&#x8981;&#x5BF9;&#x5176;&#x8FDB;&#x884C;&#x843D;&#x76D8;(Drop), &#x5426;&#x5219;&#x5C31;&#x662F;&#x76F4;&#x63A5;&#x5220;&#x9664;&#x8BE5; Block</p>
<p>&#x5B58;&#x50A8;&#x5185;&#x5B58;&#x7684;&#x6DD8;&#x6C70;&#x89C4;&#x5219;&#x4E3A;:</p>
<ol>
<li><p>&#x88AB;&#x7684;&#x6DD8;&#x6C70;&#x7684;&#x65E7; Block &#x8981;&#x4E0E;&#x65B0; Block &#x7684; MemoryNode &#x76F8;&#x540C;, &#x5373;&#x540C;&#x5C5E;&#x4E8E;&#x5806;&#x5185;&#x5185;&#x5B58;&#x6216;&#x5806;&#x5916;&#x5185;&#x5B58;</p>
</li>
<li><p>&#x65B0;&#x65E7;Block &#x4E0D;&#x80FD;&#x540C;&#x5C5E;&#x4E8E;&#x540C;&#x4E00;&#x4E2A; RDD, &#x907F;&#x514D;&#x5FAA;&#x73AF;&#x6DD8;&#x6C70;</p>
</li>
<li><p>&#x65E7; Block &#x6240;&#x5C5E; RDD &#x4E0D;&#x80FD;&#x5904;&#x4E8E;&#x88AB;&#x8BFB;&#x72B6;&#x6001;, &#x907F;&#x514D;&#x5F15;&#x53D1;&#x4E00;&#x81F4;&#x6027;&#x95EE;&#x9898;</p>
</li>
<li><p>&#x904D;&#x5386; <code>LinkedHashMap</code> &#x4E2D;&#x7684; Block, &#x6309;&#x7167;&#x6700;&#x8FD1;&#x6700;&#x5C11;&#x4F7F;&#x7528;(LRU)&#x7684;&#x987A;&#x5E8F;&#x6DD8;&#x6C70;, &#x76F4;&#x5230;&#x6EE1;&#x8DB3;&#x65B0; Block &#x6240;&#x9700;&#x7684;&#x7A7A;&#x95F4;.</p>
</li>
</ol>
<p>&#x843D;&#x76D8;&#x7684;&#x6D41;&#x7A0B;&#x5219;&#x6BD4;&#x8F83;&#x7B80;&#x5355;, &#x5982;&#x679C;&#x5176;&#x5B58;&#x50A8;&#x7EA7;&#x522B;&#x7B26;&#x53F7;<code>_useDisk</code>&#x4E3A;<code>true</code>&#x7684;&#x6761;&#x4EF6;, &#x518D;&#x6839;&#x636E;&#x5176;<code>_deserialized</code>&#x5224;&#x65AD;&#x662F;&#x5426;&#x662F;&#x975E;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x5F62;&#x5F0F;, &#x82E5;&#x662F;&#x5219;&#x5BF9;&#x5176;&#x8FDB;&#x884C;&#x5E8F;&#x5217;&#x5316;, &#x6700;&#x540E;&#x5C06;&#x6570;&#x636E;&#x5B58;&#x50A8;&#x5230;&#x78C1;&#x76D8;, &#x7136;&#x540E;&#x5728; Storage &#x6A21;&#x5757;&#x4E2D;&#x66F4;&#x65B0;&#x5176;&#x4FE1;&#x606F;</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; &#x5C1A;&#x7845;&#x8C37;&#x5927;&#x6570;&#x636E; 2019 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification"><br>&#x8BE5;&#x6587;&#x4EF6;&#x6700;&#x540E;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2019-06-10 21:43:24
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="62-nei-cun-kong-jian-fen-pei.html" class="navigation navigation-prev " aria-label="Previous page: 6.2 内存空间分配">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="64-zhi-xing-nei-cun-guan-li.html" class="navigation navigation-next " aria-label="Next page: 6.4 执行内存管理">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"6.3 存储内存管理","level":"1.6.3","depth":2,"next":{"title":"6.4 执行内存管理","level":"1.6.4","depth":2,"path":"64-zhi-xing-nei-cun-guan-li.md","ref":"64-zhi-xing-nei-cun-guan-li.md","articles":[]},"previous":{"title":"6.2 内存空间分配","level":"1.6.2","depth":2,"path":"62-nei-cun-kong-jian-fen-pei.md","ref":"62-nei-cun-kong-jian-fen-pei.md","articles":[]},"dir":"ltr"},"config":{"plugins":["splitter","expandable-chapters-small","page-toc-button","-highlight","prism","prism-themes","tbfed-pagefooter","sitemap","change_girls","livereload"],"styles":{"website":"styles/website.css","ebook":"styles/ebook.css","pdf":"styles/pdf.css","mobi":"styles/mobi.css","epub":"styles/epub.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright &copy 尚硅谷大数据 2019","modify_label":"<br>该文件最后修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prismjs/themes/prism-solarizedlight.css"]},"disqus":{"shortName":"zhenchao125"},"livereload":{},"splitter":{},"change_girls":{"time":30,"urls":["http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/62171757.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/83394736.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/15906185.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3394270.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/65028582.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/20359261.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/37472401.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/3355397.jpg-atguiguImg","http://lizhenchao.oss-cn-shenzhen.aliyuncs.com/imgs/18-3-4/11075549.jpg-atguiguImg"]},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"sitemap":{"hostname":"http://bigdataatguigu.applinzi.com/"},"page-toc-button":{"maxTocDepth":3,"minTocSize":2},"prism-themes":{},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":" 李振超","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"大数据 bigdata_spark_kernel-optimize_atguigu 课堂笔记","language":"zh-hans","links":{"sidebar":{"联系我们":"http://www.atguigu.com/"}},"gitbook":"*","description":"课堂笔记,学生提前预习"},"file":{"path":"63-cun-chu-nei-cun-guan-li.md","mtime":"2019-06-10T13:43:24.215Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-07-15T00:07:35.887Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-page-toc-button/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-change_girls/girls.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

